package com.xiaomi;

import com.xiaomi.config.RocketMQConfig;
import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer;
import org.apache.rocketmq.client.producer.DefaultMQProducer;
import org.apache.rocketmq.common.message.Message;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Main {
    public static void main(String[] args) throws Exception {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(RocketMQConfig.class);
        DefaultMQProducer producer = context.getBean(DefaultMQProducer.class);
        Message message = new Message("TestTopic", "Hello RocketMQ".getBytes());
        producer.send(message);
    }
}